﻿using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace CucumberRunner.IntegrationTests{
    [TestClass]
    public class ProfileRunnerTest{
        [TestMethod]
        public void RunWithPassingProfileReturnsTrue(){
            string testDirectory = Path.GetFullPath(Path.Combine("..", "..", "..", "..", "..", "..", "CucumberTests"));

            CucumberResults cucumberResults = new CucumberService().Run(testDirectory, "run.bat", "passingProfile", "output.txt");

            Assert.IsTrue(cucumberResults.Passed, "Passing test not picked up.");
        }

        [TestMethod]
        public void RunWithFailingProfileReturnsFalse(){
            string testDirectory = Path.GetFullPath(Path.Combine("..", "..", "..", "..", "..", "..", "CucumberTests"));

            CucumberResults cucumberResults = new CucumberService().Run(testDirectory, "run.bat", "failingProfile", "output.txt");

            Assert.IsFalse(cucumberResults.Passed, "Failing test not picked up.");
        }

        [TestMethod]
        public void RunWithDefaultProfileReturnsFalse(){
            string testDirectory = Path.GetFullPath(Path.Combine("..", "..", "..", "..", "..", "..", "CucumberTests"));

            CucumberResults cucumberResults = new CucumberService().Run(testDirectory, "run.bat", "defaultProfile", "output.txt");

            Assert.IsFalse(cucumberResults.Passed, "Failing test not picked up.");
        }
    }
}